﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="KH_QuanLyPhong.aspx.cs" Inherits="Hotel_Admin.KH_QuanLyPhong" %>

<%@ Register Assembly="Hotel.Controls" Namespace="Hotel.Controls" TagPrefix="hotel" %>
<%@ Register src="us_HelpStatus.ascx" tagname="us_HelpStatus" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .helper
        {
            float:right;
            padding-right:20px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="crmcontainer">
        <asp:UpdatePanel runat="server" ID="upInfor" UpdateMode="Conditional">
            <ContentTemplate>
                <table class="crmtable">
                    <tbody>
                        <tr>
                            <td class="crmcell right">
                                Mã phòng
                            </td>
                            <td>
                                <div class="left width-200">
                                    <asp:TextBox ID="txtMaPhong" ReadOnly="true" runat="server"></asp:TextBox>
                                </div>
                                <div class="left">
                                    <div class="right">Tên Phòng</div>
                                </div>
                                <div class="left">
                                    <asp:TextBox runat="server" ID="txtTenPhong" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="crmcell right">
                                Loại phòng
                            </td>
                            <td>
                                <div class="left width-200">
                                    <asp:DropDownList runat="server" ID="ddlLoaiPhong" />
                                </div>
                                <div class="left">
                                    <div class="right">
                                        Hàng
                                    </div>
                                </div>
                                <div class="left">
                                    <asp:DropDownList runat="server" ID="ddlHangPhong" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="crmcell right">
                                Dãy phòng
                            </td>
                            <td>
                                <div class="left width-200">
                                    <asp:DropDownList runat="server" ID="ddlDayPhong" />
                                </div>
                                <div class="left">
                                    <div class="right">
                                        Tầng
                                    </div>
                                </div>
                                <div class="left">
                                    <asp:DropDownList runat="server" ID="ddlTang" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="btnFilter" CssClass="btnGui" Text="Lọc" runat="server" 
                                    onclick="btnFilter_Click" />
                                <asp:Button ID="btnSave" CssClass="btnGui hidden" Text="Lưu" runat="server" 
                                    onclick="btnSave_Click" />
                                <asp:Button ID="btnDelete" CssClass="btnGui hidden" Text="Xóa" runat="server" 
                                    onclick="btnDelete_Click" />
                                <asp:Button ID="btnHuy" CssClass="btnGui" Text="Hủy" runat="server" 
                                    onclick="btnHuy_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td class="helper">
                                <uc1:us_HelpStatus ID="us_HelpStatus1" runat="server" />
                            </td>
                        </tr>
                    </tbody>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" ID="upChitiet" UpdateMode="Conditional">
            <ContentTemplate>
                <div class="crmcontainer" id="divChiTiet" runat="server" visible="false">
                    <div class="_divheader">THÔNG TIN CHI TIẾT DỊCH VỤ CỦA PHIẾU THUÊ</div>
                <hotel:Grid ID="gvDetail" runat="server" UseCustomPager="true" OnRowCommand="gvDetail_RowCommand">
                    <PagerSettings FirstPageText="dịch vụ " PageButtonCount="2" />
                    <Columns>
                        <asp:TemplateField HeaderText="Tên dịch vụ" HeaderStyle-Width="5%">
                            <ItemTemplate>
                                <%# Eval("DICH_VU.TenDV")%>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Đơn vị tính" HeaderStyle-Width="5%">
                            <ItemTemplate>
                                <%# Eval("DVT.TenDonViTinh")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số lượng" HeaderStyle-Width="5%">
                            <ItemTemplate>
                                <%# String.Format("{0:0,0}",Eval("SoLuong"))%>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                         <asp:TemplateField HeaderText="Đơn giá" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                <%# String.Format("{0:0,0}",Eval("DonGia"))%>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Thành tiền" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                <%# String.Format("{0:0,0}",decimal.Parse(Eval("SoLuong").ToString())*
                                                                    decimal.Parse(Eval("DonGia").ToString()))%>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tùy chọn" HeaderStyle-Width="10%">
                            <ItemTemplate>
                               <asp:LinkButton ID="linkXoa" runat="server" CommandArgument='<%# Eval("MaPhieuSuDungDichVu") %>' CommandName="XoaDichVu" CssClass="link" Text="Xóa dịch vụ"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </hotel:Grid>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" ID="upGird" UpdateMode="Conditional">
            <ContentTemplate>
                <hotel:Grid ID="gvList" runat="server" UseCustomPager="true" 
                    OnRowCommand="gvList_RowCommand" onrowdatabound="gvList_RowDataBound">
                    <PagerSettings FirstPageText="phòng " PageButtonCount="2" />
                    <Columns>
                        <asp:TemplateField HeaderText="Lịch sử" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkBtnID" runat="server" CommandArgument='<%# Eval("MaPhieuThue") %>'
                                    CommandName="EditItem" CssClass="link" Text="Xem chi tiết"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tầng" HeaderStyle-Width="5%">
                            <ItemTemplate>
                                <%# Eval("PHONG.TANG_PHONG.TenTang")%>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Dãy" HeaderStyle-Width="5%">
                            <ItemTemplate>
                                <%# Eval("PHONG.DAY_PHONG.TenDay")%>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                         <asp:TemplateField HeaderText="Loại phòng" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                <%# Eval("PHONG.LOAI_PHONG.TenLoaiPhong") %>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tên phòng" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                <%# Eval("PHONG.TenPhong") %>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Loại dịch vụ" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:DropDownList runat="server" ID="ddlLoaiDichVu" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Đơn vị tính" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:DropDownList runat="server" ID="ddlDonViTinh" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số lượng" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:TextBox runat="server" ID="txtSoLuong" Width="90%" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tùy chọn" HeaderStyle-Width="10%">
                            <ItemTemplate>
                               <asp:LinkButton ID="linkThemDichVu" runat="server" CommandArgument='<%# Eval("MaPhieuThue") %>' CommandName="AddDichVu" CssClass="link" Text="Thêm dịch vụ"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tình trạng " HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:Panel runat="server" ID="status" ForeColor="White" HorizontalAlign="Center" Height="20px">
                                    <%# Eval("PHONG.TRANG_THAI.TenTrangThai") %>
                                </asp:Panel>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                    </Columns>
                </hotel:Grid>
            </ContentTemplate>
        </asp:UpdatePanel>
        
    </div>
</asp:Content>
